package com.gopay.common.core.dic.dao.impl;

import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseReadDAOImpl;
import com.gopay.common.core.dic.dao.DicGopayBankInfoQueryDAO;
import com.gopay.common.domain.dic.DicGopayBankInfo;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/** 
 * 国付宝银行信息字典表DAO类
 * 
 * @DicGopayBankInfoQueryDAOImpl.java
 * @author fanghw
 * @2016年6月6日 下午5:27:12  www.gopay.com.cn Inc.All rights reserved.
 */
@Repository("dicGopayBankInfoQueryDAO")
public class DicGopayBankInfoQueryDAOImpl extends BaseReadDAOImpl<DicGopayBankInfo, String>
        implements DicGopayBankInfoQueryDAO {


    @Override
    public DicGopayBankInfo findByAbbrCode(String abbrCode) {
        String hql="from DicGopayBankInfo d where d.abbrCode=:abbrCode";
        Map<String, Object> param = new HashMap<String, Object>();
        param.put("abbrCode", abbrCode);
        List<DicGopayBankInfo> list = super.findByHql(hql, param);
        return list == null || list.size() == 0 ? null : list.get(0);
    }

    @Override
    public List<DicGopayBankInfo> getAllBankList(){
        String hql = "from DicGopayBankInfo d where d.stat='00' order by d.code asc ";
        return super.findByHql(hql);
    }

}
